x86/ept: defer the invalidation until the p2m lock is released
authorDavid Vrabel <david.vrabel@citrix.com>
Tue, 12 Apr 2016 16:19:43 +0000 (17:19 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 22 Apr 2016 10:54:15 +0000 (11:54 +0100)
commit09fc40ed3054fe58528c3847d2fcb77d8249b726
tree45f05f26a50f2b5d68589497000baabe7cee19db
parent83a5839960db70f3552417379ad2677a6b473b20
x86/ept: defer the invalidation until the p2m lock is released

Holding the p2m lock while calling ept_sync_domain() is very expensive
since it does an on_selected_cpus() call.  IPIs on many socket
machines can be very slow and on_selected_cpus() is serialized.

It is safe to defer the invalidate until the p2m lock is released
except for two cases:

1. When freeing a page table page (since partial translations may be
   cached).
2. When reclaiming a zero page as part of PoD.

For these cases, add p2m_tlb_flush_sync() calls which will immediately
perform the invalidate before the page is freed or reclaimed.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: George Dunlap <geroge.dunlap@citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/mm/mm-locks.h
xen/arch/x86/mm/p2m-ept.c
xen/arch/x86/mm/p2m-pod.c
xen/arch/x86/mm/p2m.c
xen/include/asm-x86/p2m.h